package ltd.smallwang;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

/**
 * @author justd
 * @date 2024-11-03 20:07
 */
class Leetcode0209Test {

  private final Leetcode0209 leetcode0209 = new Leetcode0209();

  @Test
  void minSubArrayLen01() {
    Assertions.assertThat(leetcode0209.minSubArrayLen(7, new int[]{2, 3, 1, 2, 4, 3})).isEqualTo(2);
  }

  @Test
  void minSubArrayLen02() {
    Assertions.assertThat(leetcode0209.minSubArrayLen(4, new int[]{1, 4, 4})).isEqualTo(1);
  }

  @Test
  void minSubArrayLen03() {
    Assertions.assertThat(leetcode0209.minSubArrayLen(11, new int[]{1, 1, 1, 1, 1, 1, 1, 1}))
        .isEqualTo(0);
  }

  @Test
  void minSubArrayLen04() {
    Assertions.assertThat(leetcode0209.minSubArrayLen(11, new int[]{1, 2, 3, 4, 5}))
        .isEqualTo(3);
  }
}